package com.itshizhan.databindingdemo

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.databinding.DataBindingUtil
import com.itshizhan.databindingdemo.databinding.ActivityMainBinding

class MainActivity : AppCompatActivity() {


    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        //        val binding: ActivityMainBinding = ActivityMainBinding.inflate(layoutInflater)
        //        setContentView(binding.root)
        val binding: ActivityMainBinding = DataBindingUtil.setContentView( this, R.layout.activity_main)
        binding.student = Student("Jack Ma", 18)
    }
}